package com.mdd.front.controller;


import com.mdd.common.core.AjaxResult;
import com.mdd.common.core.PageResult;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.front.service.specification.IGoodsSpecificationService;
import com.mdd.front.validate.PageParam;
import com.mdd.front.validate.specification.GoodsSpecificationParam;
import com.mdd.front.vo.specification.GoodsSpecificationDetailVo;
import com.mdd.front.vo.specification.GoodsSpecificationListVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 服务规格管理
 */
@RestController
@RequestMapping("api/specification")
public class GoodsSpecificationController {

    @Resource
    IGoodsSpecificationService iGoodsSpecificationService;

    /**
     * 服务规格列表
     *
     * @param pageParam 分页参数
     * @param params 搜索参数
     * @return Object
     */
    @GetMapping("/list")
    public Object list(@Validated PageParam pageParam,
                       @RequestParam Map<String, String> params) {
        PageResult<GoodsSpecificationListVo> list = iGoodsSpecificationService.list(pageParam, params);
        return AjaxResult.success(list);
    }

}
